package com.nl.controller.web.controller;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.nl.controller.web.service.TimedTaskService;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Component
public class TimedTask {
	@Autowired
	private TimedTaskService taskService;
	public static Map<String,String> map = new ConcurrentHashMap<String, String>();
	//第一次延迟30秒后执行，之后按fixedRate的规则每300秒执行一次。
    @Scheduled(initialDelay = 30000, fixedRate = 50000)
    public void syn() {
    	log.info("上行审核开始");
    	taskService.checkMgr(map);
		 
    }
//    public static void main(String[] args) {
//		HashMap< String , String > map = new HashMap<String, String>();
//		map.put("1000000001", "1");
//		  
//		System.out.println(map.containsKey("1000000001"));
//	}
    //@Scheduled(initialDelay = 30000, fixedRate = 60000)
//    public void querySent() {
//    	log.info("同步开始");
//    	taskService.checkMgr(map);
//		 
//    }
    
//    @Scheduled(initialDelay = 30000, fixedRate = 10000)
//    public void test(){
//    	taskService.test(map);
//    }
    
}
